<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/views/common/includeCommon.jsp"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html lang="en_US">
    <head>
        <title><spring:message code="app.courseTemplate.edit.title" /></title>
        <link rel="stylesheet" type="text/css" href="${ctx}/assets/jqueryplugin/jquerycrop/jquery.Jcrop.css">
        <link rel="stylesheet" type="text/css" href="${ctx}/static/css/manage/manage.jcrop.css">
        <script type="text/javascript" src="${ctx}/assets/jqueryplugin/jquery-migrate/jquery-migrate-1.4.1.js"></script>
        <script type="text/javascript" src="${ctx}/assets/jqueryplugin/jquerycrop/jquery.Jcrop.js"></script>
        <script type="text/javascript">
			var courseTemplateId = '${courseTemplateId}';
			var width_bl = '${width_bl}';
			var fjUrl = '${fjUrl}';
			var sfsf = '${sfsf}';
			var img_width = '${img_width}';
			var img_height = '${img_height}';
		</script>
        <script type="text/javascript" src="${ctx}/static/js/manage/courseTemplate/edit.js"></script>
    </head>
    <body>
        <!-- <div style="display:none;color:#666;top:0;font-weight:bold;height:36px;line-height:36px;margin-left: 2px;">
			提示：请设置该科目答卷定位点区域、考生信息区域和需要阅卷的题目区域。
		</div> -->
        <div style="position:relative;height: 100%;">
			<img <c:if test="${sfsf=='true'}">width=${img_width} height=${img_height}</c:if> 
				src="${ctx}/static/upload/courseTemplate/${fjUrl}" id="element_id"/>
			<c:set var="x1"/>
			<c:set var="x2"/>
			<c:set var="y1"/>
			<c:set var="y2"/>
			<c:set var="id"/>
			
			<c:forEach items="${posList}" var="oneMap">
				<c:set var="id" value="${oneMap.id}"/>
				<c:choose>
					<c:when test="${sfsf=='true'}">
						<c:set var="x1" value="${oneMap.x1 * width_bl}"/>
						<c:set var="x2" value="${oneMap.x2 * width_bl}"/>
						<c:set var="y1" value="${oneMap.y1 * width_bl}"/>
						<c:set var="y2" value="${oneMap.y2 * width_bl}"/>
					</c:when>
					<c:otherwise>
						<c:set var="x1" value="${oneMap.x1}"/>
						<c:set var="x2" value="${oneMap.x2}"/>
						<c:set var="y1" value="${oneMap.y1}"/>
						<c:set var="y2" value="${oneMap.y2}"/>
					</c:otherwise>
				</c:choose>
				<div class="one-position" title="${oneMap.areaTitle}"
					style="width:${x2 - x1}px;height:${y2 - y1}px;top:${y1}px;left:${x1}px" 
				    px1="${x1}" py1="${y1}" px2="${x2}" py2="${y2}" pos_id="${id}" width_bl="${width_bl}">
				    
					<div class="one-position-oper">
						<a class="a_edit_position" href="javascript:void(0);" title="编辑属性">
							<img alt="" src="${ctx}/static/images/common/table_edit.png">
						</a><span class="hoverSpilt">|</span>
						<a class="a_del_position" href="javascript:void(0);" title="删除区域">
							<img alt="" src="${ctx}/static/images/common/cancel.png">
						</a>
					</div>
				</div>
			</c:forEach>
		</div>
		
		<input type="hidden" id="x1" name="x1" />
		<input type="hidden" id="y1" name="y1" />
		<input type="hidden" id="x2" name="x2" />
		<input type="hidden" id="y2" name="y2" />
    </body>
</html>